#include <linux/init.h>
#include <linux/module.h>
#include <linux/spi/spi.h>

int m74hc595_probe(struct spi_device* spi)
{
    unsigned char buf[] = {0x4,0x6d};
    unsigned char buf1[] = {0x8,0x6d};
    printk("%s:%d\n", __func__, __LINE__);

    while(1){
        spi_write(spi,buf,2);
        spi_write(spi,buf1,2);
    }

    return 0;
}
int m74hc595_remove(struct spi_device* spi)
{
    printk("%s:%d\n", __func__, __LINE__);
    return 0;
}

struct of_device_id oftable[] = {
    {.compatible = "hqyj,m74hc595",},
    {}
};
MODULE_DEVICE_TABLE(of,oftable);

struct spi_driver m74hc595 = {
    .probe = m74hc595_probe,
    .remove = m74hc595_remove,
    .driver = {
        .name = "m74hc595",
        .of_match_table = oftable,
    },
};
module_spi_driver(m74hc595);
MODULE_LICENSE("GPL");